// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.*;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;
// import com.alibaba.druid.util.MySqlUtils;

// import java.text.ParseException;
// import java.text.SimpleDateFormat;
// import java.util.*;
#pragma once
#include <string>
#include <list>
#include <sys/time.h>
#include "../SQLExprImpl.h"
#include "SQLLiteralExpr.h"
#include "SQLValuableExpr.h"
#include "../SQLReplaceable.h"
// #include <boost/date_time/posix_time/posix_time.hpp>
// #include <boost/date_time/local_time/local_time.hpp>
#include <chrono>
#include "../../../utils/common_ptr.h"

class SQLDataType;
class DbType;

class SQLDateExpr : public SQLExprImpl, virtual public SQLLiteralExpr, virtual public SQLValuableExpr, virtual public SQLReplaceable
{
public:
  static SQLDataType_ptr DATA_TYPE;
  static long supportDbTypes;

  string_ptr  literal;

  SQLDateExpr();

  SQLDateExpr(string_ptr  literal);

  SQLDateExpr(long literal);

  SQLDateExpr(long literal, string_ptr  timeZone);
  SHAREDOBJECT(SQLDateExpr);

  string_ptr  getLiteral();

  void setLiteral(string_ptr  literal);

  void setLiteral(long x);

  void setLiteral(long x, string_ptr  timeZone);

  string_ptr  getValue();

  std::shared_ptr<std::chrono::system_clock::time_point> getDate();

  std::shared_ptr<std::chrono::system_clock::time_point> getDate(string_ptr  timeZone);

  BOOL_ptr addDay(int delta);

  BOOL_ptr addMonth(int delta);

  BOOL_ptr addYear(int delta);

  //@Override
  void accept0(SQLASTVisitor_ptr visitor);

  //@Override
  int hashCode();

  //@Override
  bool equals(Object_ptr obj);

  virtual SQLObject_ptr clone();

  //@Override
  BOOL_ptr replace(SQLExpr_ptr expr, SQLExpr_ptr target);

  //@Override
  SQLObject_list_ptr getChildren();

  static BOOL_ptr isSupport(DbType_ptr dbType);

  static BOOL_ptr check(string_ptr  str);

  // static string_ptr  format(Calendar calendar) ;

  SQLDataType_ptr computeDataType();
};
